.class public Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;
.super Lcom/waiqin365/lightapp/im/activity/IMBaseActivity;


# instance fields
.field private a:Landroid/widget/ProgressBar;

.field private b:Ljava/io/File;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Lcom/waiqin365/lightapp/im/activity/IMBaseActivity;-><init>()V

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;)Ljava/io/File;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->b:Ljava/io/File;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;)Landroid/widget/ProgressBar;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->a:Landroid/widget/ProgressBar;

    return-object v0
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 6

    invoke-super {p0, p1}, Lcom/waiqin365/lightapp/im/activity/IMBaseActivity;->onCreate(Landroid/os/Bundle;)V

    const v0, 0x7f030147

    invoke-virtual {p0, v0}, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->setContentView(I)V

    const v0, 0x7f0c0787

    invoke-virtual {p0, v0}, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ProgressBar;

    iput-object v0, p0, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->a:Landroid/widget/ProgressBar;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string/jumbo v1, "msgbody"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Lcom/hyphenate/chat/EMFileMessageBody;

    new-instance v1, Ljava/io/File;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMFileMessageBody;->getLocalUrl()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v1, p0, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;->b:Ljava/io/File;

    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->getChatConfig()Lcom/hyphenate/chat/EMChatConfig;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMChatConfig;->getAccessToken()Ljava/lang/String;

    move-result-object v2

    const-string/jumbo v3, "Authorization"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "Bearer "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v1, v3, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMFileMessageBody;->getSecret()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_0

    const-string/jumbo v2, "share-secret"

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMFileMessageBody;->getSecret()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v1, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_0
    const-string/jumbo v2, "Accept"

    const-string/jumbo v3, "application/octet-stream"

    invoke-interface {v1, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v2

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMClient;->chatManager()Lcom/hyphenate/chat/EMChatManager;

    move-result-object v2

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMFileMessageBody;->getRemoteUrl()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMFileMessageBody;->getLocalUrl()Ljava/lang/String;

    move-result-object v0

    new-instance v4, Lcom/waiqin365/lightapp/im/activity/cz;

    invoke-direct {v4, p0}, Lcom/waiqin365/lightapp/im/activity/cz;-><init>(Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;)V

    invoke-virtual {v2, v3, v0, v1, v4}, Lcom/hyphenate/chat/EMChatManager;->downloadFile(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/hyphenate/EMCallBack;)V

    return-void
.end method
